<template>
  <div class="coupon">
    <a-tooltip placement="topLeft" title="点击前往" arrow-point-at-center>
      <img class="cover" :src="cover" @click="cardClick">
    </a-tooltip>
    <div class="content">
      <div class="left">
        <p class="title">{{title}}</p>
        <p class="text">{{introduce}}</p>
      </div>
      <div class="right">
        <a-button type="danger" size="large" @click="btnClick">
          点击前往
        </a-button>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      title: {
        type: String
      },
      cover: {
        type: String
      },
      introduce: {
        type: String
      }
    },
    methods: {
      cardClick() {
        this.$emit('cardClick');
      },
      btnClick() {
        this.$emit('btnClick');
      }
    }
  }
</script>

<style scoped>
  p {
    margin: 0;
  }
  .coupon {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 1px 1px 4px #ced6e0;
  }
  .coupon .cover {
    width: 100%;
  }
  .coupon .cover:hover {
    cursor: pointer;
    transform: scale(1.1);
    transition: 0.2s ease-in-out;
  }
  .title {
    font-size: 0.18rem;
    font-weight: 700;
  }
  .text {
    font-size: 0.1rem;
    margin-top: 0.02rem;
  }
  .content {
    display: flex;
    position: relative;
    padding: 0.1rem;
    background-color: #FFFFFF;
  }
  .content .right {
    position: absolute;
    right: 0.1rem;
    top: 50%;
    transform: translateY(-50%);
  }
  .ant-btn-lg {
    height: 0.28rem;
    padding: 0 0.06rem;
    font-size: 0.1rem;
    border-radius: 4px;
  }
</style>
